package com.ruoyi.cabinet.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.cabinet.mapper.CabGoodsOutMapper;
import com.ruoyi.cabinet.domain.CabGoodsOut;
import com.ruoyi.cabinet.service.ICabGoodsOutService;

/**
 * 物品出库Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-31
 */
@Service
public class CabGoodsOutServiceImpl implements ICabGoodsOutService 
{
    @Autowired
    private CabGoodsOutMapper cabGoodsOutMapper;

    /**
     * 查询物品出库
     * 
     * @param outId 物品出库主键
     * @return 物品出库
     */
    @Override
    public CabGoodsOut selectCabGoodsOutByOutId(Long outId)
    {
        return cabGoodsOutMapper.selectCabGoodsOutByOutId(outId);
    }

    /**
     * 查询物品出库列表
     * 
     * @param cabGoodsOut 物品出库
     * @return 物品出库
     */
    @Override
    public List<CabGoodsOut> selectCabGoodsOutList(CabGoodsOut cabGoodsOut)
    {
        return cabGoodsOutMapper.selectCabGoodsOutList(cabGoodsOut);
    }

    /**
     * 新增物品出库
     * 
     * @param cabGoodsOut 物品出库
     * @return 结果
     */
    @Override
    public int insertCabGoodsOut(CabGoodsOut cabGoodsOut)
    {
        cabGoodsOut.setCreateTime(DateUtils.getNowDate());
        return cabGoodsOutMapper.insertCabGoodsOut(cabGoodsOut);
    }

    /**
     * 修改物品出库
     * 
     * @param cabGoodsOut 物品出库
     * @return 结果
     */
    @Override
    public int updateCabGoodsOut(CabGoodsOut cabGoodsOut)
    {
        cabGoodsOut.setUpdateTime(DateUtils.getNowDate());
        return cabGoodsOutMapper.updateCabGoodsOut(cabGoodsOut);
    }

    /**
     * 批量删除物品出库
     * 
     * @param outIds 需要删除的物品出库主键
     * @return 结果
     */
    @Override
    public int deleteCabGoodsOutByOutIds(Long[] outIds)
    {
        return cabGoodsOutMapper.deleteCabGoodsOutByOutIds(outIds);
    }

    /**
     * 删除物品出库信息
     * 
     * @param outId 物品出库主键
     * @return 结果
     */
    @Override
    public int deleteCabGoodsOutByOutId(Long outId)
    {
        return cabGoodsOutMapper.deleteCabGoodsOutByOutId(outId);
    }
}
